<T:ViewBase x:Class="WPFExcelReport.TIVC"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"   
                    xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
                    xmlns:me="clr-namespace:WPFExcelReport"  
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"    
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"  
                    Name="TV"
                    Background="White"    
                    Loaded="Window_Loaded"
     >
    <T:ViewBase.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:TextTrimmingConverter x:Key="trim"/>
    </T:ViewBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel   Grid.Row="0"   >
            <WrapPanel>
                <Label Content="{Binding Source={Localization:Translate Word=公司：}}"    Width="Auto" Margin="10,0,0,0"     FontSize="18"  Foreground="#FF141111" />
                <TextBox Text="" Name="txtFACTORY" Width="54" Margin="5,0,0,0"  HorizontalAlignment="Left" Background="Pink"   Panel.ZIndex="1" 
                         KeyUp="txtART_KeyUp" CharacterCasing="Upper" MaxLength="5" FontSize="18" Foreground="#FF141111" />
                <Label Content="{Binding Source={Localization:Translate Word=货币：}}"    Width="Auto" Margin="10,0,0,0"     FontSize="18"  Foreground="#FF141111" />
                <TextBox Text="" Name="txtCURR" Width="52" Margin="5,0,0,0"  HorizontalAlignment="Left" Background="Pink"   Panel.ZIndex="2" 
                         KeyUp="txtART_KeyUp" CharacterCasing="Upper" MaxLength="3" FontSize="18" Foreground="#FF141111" />
                <Label Content="{Binding Source={Localization:Translate Word=任务书：}}"    Width="Auto" Margin="10,0,0,0"     FontSize="18"  Foreground="#FF141111" />
                <TextBox Text="{Binding ART,ElementName=TV}" Name="txtART" Width="151" Margin="5,0,0,0"  HorizontalAlignment="Left" Background="Pink"   Panel.ZIndex="3" 
                         KeyUp="txtART_KeyUp" CharacterCasing="Upper" MaxLength="20" FontSize="18" Foreground="#FF141111" />
                <Label Content="{Binding Source={Localization:Translate Word=发票号：}}"    Width="Auto" Margin="10,0,0,0"     FontSize="18"  Foreground="#FF141111" />
                <TextBox Text="" Name="txtINV" Width="151" Margin="5,0,0,0"  HorizontalAlignment="Left" Background="Pink" Panel.ZIndex="4" 
                         KeyUp="txtART_KeyUp" CharacterCasing="Upper" MaxLength="15" FontSize="18" Foreground="#FF141111" />
                <Label Content="{Binding Source={Localization:Translate Word=日期从}}"   HorizontalAlignment="Left" Margin="10,0,0,0"  Width="Auto" FontSize="16" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0"    Panel.ZIndex="5"
                            Text="{Binding FROMDATE,ElementName=TV}" SelectedDateChanged ="FROM_DATE_SelectedDateChanged"  Width="126" />
                <Label Content="{Binding Source={Localization:Translate Word=到}}" Height="28" HorizontalAlignment="Left" Margin="10,0,0,0"   Width="Auto" FontSize="16" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,0,0,0"   VerticalAlignment="Center" Panel.ZIndex="6"
                                  Text="{Binding ENDDATE,ElementName=TV}"    SelectedDateChanged ="END_DATE_SelectedDateChanged" Width="122" />
                <Button Content="{Binding Source={Localization:Translate Word=查询}}" Height="33" Margin="10,0,0,0"   Width="96"  Panel.ZIndex="10"
                        Click="QueryCommand"/>
                <Button Content="{Binding Source={Localization:Translate Word=导出}}" Height="33" Margin="10,0,0,0"   Width="100" Panel.ZIndex="11"
                      Click="PrintCommand"/>
            </WrapPanel> 
        </StackPanel>
        <StackPanel   Grid.Row="1"   >
            <WrapPanel>
                <Label Content="{Binding Source={Localization:Translate Word=制造费：}}"    Width="Auto" Margin="10,0,0,0"     FontSize="16"  Foreground="#FF141111" />
                <TextBox Text="" Name="txtPRODVALUE" Width="54" Margin="5,0,0,0"  HorizontalAlignment="Left" Background="Pink"   Panel.ZIndex="20" 
                         KeyUp="txtART_KeyUp" CharacterCasing="Upper" MaxLength="8" FontSize="16" Foreground="#FF141111" />
                <Label Content="{Binding Source={Localization:Translate Word=期间费用：}}"    Width="Auto" Margin="10,0,0,0"     FontSize="16"  Foreground="#FF141111" />
                <TextBox Text="" Name="txtOTHERS" Width="62" Margin="5,0,0,0"  HorizontalAlignment="Left" Background="Pink"   Panel.ZIndex="21" 
                         KeyUp="txtART_KeyUp" CharacterCasing="Upper" MaxLength="8" FontSize="16" Foreground="#FF141111" />
                <Button Content="{Binding Source={Localization:Translate Word=批量修改}}" Height="33" Margin="10,0,0,0"   Width="96"  Panel.ZIndex="22"
                        Click="SaveCommand"/>
                <Label Content="{Binding Source={Localization:Translate Word=注意：批量修改将满足上面查询条件的记录全部进行更新，请确认查询条件！}}" Width="Auto" Margin="10,0,0,0"     FontSize="16"  Foreground="#FF141111" />

            </WrapPanel>
        </StackPanel>
        <DataGrid  Grid.Row="2"   
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"
                   Name="dlgMaster"
                   ItemsSource="{Binding Source={StaticResource vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True"  IsReadOnly="True"
                    >
            <DataGrid.Columns>                
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=公司}}" Binding="{Binding FACTORY}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=货币}}" Binding="{Binding CURRENCY}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=汇率}}" Binding="{Binding RATE}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=发票号}}" Binding="{Binding INVOICE}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=任务书}}" Binding="{Binding VKPART}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=色号}}" Binding="{Binding COLOR, Converter={StaticResource ResourceKey=trim }}" Width="Auto" MaxWidth="100"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=品名}}" Binding="{Binding VAABEZ, Converter={StaticResource ResourceKey=gb2312 }}" Width="Auto"/>
                <!--DataGridTextColumn Header="{Binding Source={Localization:Translate Word=用纱}}" Binding="{Binding YARN, Converter={StaticResource ResourceKey=trim }}" Width="Auto" MaxWidth="100"/-->
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=规格}}" Binding="{Binding CONSTRUCTION, Converter={StaticResource ResourceKey=gb2312 }}" Width="Auto" MaxWidth="100"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=类型}}" Binding="{Binding TYPE}" Width="Auto" MaxWidth="100"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=经密}}" Binding="{Binding WARPDEN}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=纬密}}" Binding="{Binding WEFTDEN}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=客户}}" Binding="{Binding KDKNAME, Converter={StaticResource ResourceKey=gb2312 }}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=码数}}" Binding="{Binding YDELQTY}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=米数}}" Binding="{Binding MDELQTY}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=纬密总数}}" Binding="{Binding WEFTTOT}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=经纱用量}}" Binding="{Binding WARPUSAGE}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=经纱单价}}" Binding="{Binding WARPPRICE}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=纬纱用量}}" Binding="{Binding WEFTUSAGE}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=纬纱单价}}" Binding="{Binding WEFTPRICE}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=原料金额}}" Binding="{Binding YARNVALUE}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=经染单价}}" Binding="{Binding WARPED}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=纬染单价}}" Binding="{Binding WEFTED}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=染色费}}" Binding="{Binding DYEVALUE}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=整理费}}" Binding="{Binding MCOSTFIN}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=包装运输费}}" Binding="{Binding MCOSTPAKVV}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=其它}}" Binding="{Binding MCOSTFADD}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=佣金单价}}" Binding="{Binding MPRICEAGENT}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=佣金}}" Binding="{Binding MCOSTAGENT}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=海运单价}}" Binding="{Binding MPRICESHIP}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=海运费}}" Binding="{Binding MCOSTSHIP}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=空运单价}}" Binding="{Binding MPRICEFLIGHT}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=空运费}}" Binding="{Binding MCOSTFLIGHT}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=其它}}" Binding="{Binding MCOSTADD}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=成本合计}}" Binding="{Binding MCOSTUNIT}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=销售单价RMB}}" Binding="{Binding RMBPRICE}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=毛工交}}" Binding="{Binding MCOSTGROSS}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=净工交}}" Binding="{Binding MCOSTNET}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=工交总额}}" Binding="{Binding COSTTOT}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=万纬工交}}" Binding="{Binding COSTTOTW}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=营销员}}" Binding="{Binding STAFF, Converter={StaticResource ResourceKey=gb2312 }}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=是否脱单}}" Binding="{Binding COMMISSION, Converter={StaticResource ResourceKey=gb2312 }}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=是否新品种}}" Binding="{Binding NEWART, Converter={StaticResource ResourceKey=gb2312 }}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=单价/M}}" Binding="{Binding PRICE}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=发票金额}}" Binding="{Binding INVVALUE}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=人民币金额}}" Binding="{Binding RMBVALUE}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=制造费}}" Binding="{Binding PRODVALUE}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=期间费用}}" Binding="{Binding OTHERSVALUE}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=记帐日期}}" Binding="{Binding INVDAT}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=发货日期}}" Binding="{Binding DELDAT}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=备注}}" Binding="{Binding REMARK, Converter={StaticResource ResourceKey=gb2312 }}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=ROWNID}}" Binding="{Binding ROWNID}" Width="Auto"/>
            </DataGrid.Columns>
        </DataGrid  >
    </Grid>

</T:ViewBase>
